package com.alibaba.cloud.client9093.config;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.util.HashMap;
import java.util.Map;

/**
 * created by wuquan at 05/09/2021
 * ^_^ ^_^
 */
@ControllerAdvice
public class GlobalExceptionHandle {

    @ExceptionHandler(value = IllegalArgumentException.class)
    public Map<String, Object> errorHandler(IllegalArgumentException exception) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", 400);
        return map;
    }
}
